import request from '@/utils/request'
import { extendsObj } from '@/utils'

// 事件管理接口

/**
 * 获取事件详情
 *
 * @export
 * @param {*} data { id }
 * @returns
 */
export function fetchEventGet(params, options) {
  return request({
    url: '/event/get',
    method: 'get',
    params,
    ...options
  })
}

/**
 * 获取事件列表
 *
 * @export
 * @param {*} data { page, pagesize, qualityType, reporterDeptId, startReportTime, endReportTime, status }
 * @returns
 */
export function fetchEventList(data, options) {
  const defaultQuery = {
    page: 1,
    pagesize: 10,
    qualityType: '',
    reporterDeptId: 0,
    status: 0,
    startReportTime: '',
    endReportTime: ''
  }
  return request({
    url: '/event/findPage',
    method: 'post',
    data: extendsObj(defaultQuery, data),
    ...options
  })
}
